<?php

class Application_Model_DbTable_AuthTokens extends Application_Db_TableAbstract
{
    protected $_name = 'auth_tokens';
    protected $_rowClass = 'Application_Model_DbRow_AuthToken';

    protected $_referenceMap    = array(
        'User' => array(
            'columns'           => array('user_id'),
            'refTableClass'     => 'Application_Model_DbTable_Users',
            'refColumns'        => array('id')
        )
    );

    public function findByToken($token)
    {
        return $this->_findByColumn('token', $token);
    }
}